<template>
	<view>
		<view class="titleBox">
			<view class="titleLeft">
				<img src="../../static/title/back.png" class="titleBack" @click="goBack">
			</view>
			<view class="titleText">
				<text>现金提现</text>
			</view>
			<view class="titleRight">

			</view>
		</view>
		<!--  -->
		<view class="box">
			<!--  -->
			<view class="box-item">
				<view class="">
					可提现金额
				</view>
				<view class="box-price">
					<input type="text" v-model="sumUpMoney">
				</view>
			</view>
			<!--  -->
			<view class="box-item">
				<view class="box-item-2">
					<view class="">
						提现金额
					</view>
					<view class="box-input">
						<text>￥</text>
						<input type="text" placeholder="请输入提现金额" v-model="withdrawDeposit">
					</view>
				</view>
				<view class="item-all" @click="handerClick">
					全部提现
				</view>
			</view>
			<!--  -->
			<view class="box-queren">
				提现至钱包，可直接转入银行卡
			</view>
		</view>
		<!--  -->
		<view class="btn">
			<button @click="onClick">确认提现</button>
		</view>
		<!--  -->
		<view class="bom-box">
			<view class="bom-box1">
				<text></text>
				<text class="text">提现明细</text>
				<text></text>
			</view>
			<view class="bom-box2">
				暂无提现记录
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 可提现金额
				sumUpMoney:9999,
				// 提现金额
				withdrawDeposit:''
			};
		},
		methods: {
			// 返回
			goBack() {
				uni.navigateBack(0)
			},
			// 跳转到钱包
			goWallet() {
				uni.navigateTo({
					url: '/pages/my/wallet'
				})
			},
			// 点击提现
			onClick() {
				uni.request({
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					url: 'https://ypsf.huashengzhuan.cn/Application/NewShopApi.ashx?action=cashOut',
					method: 'POST',
					data: {
						OpenID: 'owner',
						Amount:this.withdrawDeposit,
						CashOutType:'2',
						BankAccount:'62226245555544897464'
					},
					dataType: 'json',
					success: res => {
						console.log(res);
					}
				})
			},
			// 点击全部提现
			handerClick() {
				this.withdrawDeposit = this.sumUpMoney
			}
		}
	}
</script>

<style lang="scss">
	.box {
		width: 692rpx;
		height: 382rpx;
		background: #FFFFFF;
		border-radius: 13px 13px 13px 13px;
		opacity: 1;
		margin: 8rpx auto;
		font-size: 24rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #D2D2D2;
		padding: 0 30rpx;
		box-sizing: border-box;

		.box-item {
			line-height: 85rpx;
			border-bottom: 1px solid rgba(210, 210, 210, 0.11);

			.box-price {
				font-size: 38rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #1B1C1E;
			}

			input {
				width: 200rpx;
				color: #1B1C1E;
			}

			.box-item-2 {
				line-height: 50rpx;

				.box-input {
					display: flex;

					text {
						font-size: 38rpx;
						color: #1B1C1E;
					}
				}
			}

			.item-all {
				position: absolute;
				right: 60rpx;
				top: 330rpx;
				font-size: 24rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				color: #0196F9;
			}
		}

		.box-queren {
			margin-top: 24rpx;
		}
	}

	.btn {
		width: 100%;

		button {
			width: 692rpx;
			height: 88rpx;
			background: #FF5F17;
			border-radius: 44rpx;
			opacity: 1;
			font-size: 34rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: rgba(255, 255, 255, 0.98);
			margin-top: 48rpx;
		}
	}

	.bom-box {
		width: 100%;
		text-align: center;
		margin-top: 66rpx;

		.bom-box1 {
			position: relative;
			position: sticky;
			font-size: 30rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #1B1C1E;

			text {
				display: inline-block;
				width: 134rpx;
				height: 0rpx;
				opacity: 1;
				border: 1rpx solid rgba(210, 210, 210, 0.31);
				margin: 0 30rpx;
			}

			.text {
				position: absolute;
				position: sticky;
				top: 8rpx;
				left: 273rpx;
				border: none;
				margin: 0 30rpx;
			}
		}

		.bom-box2 {
			font-size: 30rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #747475;
			margin-top: 20rpx;
		}
	}
</style>
